package cn.tedu.tmall.passport.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class UserLoginInfoParam implements Serializable {

    @ApiModelProperty(value = "用户名", required = true)
    @NotNull(message = "登录失败，请提交用户名！")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9_]{3,14}$", message = "登录失败，用户名必须是4~15位由字母、数字、下划线组成，且第1个字符必须是字母！")
    private String username;

    @ApiModelProperty(value = "密码", required = true)
    @NotNull(message = "登录失败，请提交密码！")
    @Pattern(regexp = "^[a-zA-Z0-9\\p{P}\\p{S}]{4,15}$", message = "登录失败，密码必须是4~15位由字母、数字、英文的标点符号组成！")
    private String password;

}
